import java.util.Scanner;

public class Main {
    //素数
    public static boolean isPrime(int n) {
        for (int i = 2; i <= n / 2; i++) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int left = n / 2;
        while (true) {
            while (!isPrime(left)) {
                left--;
            }
            int tmp = n - left;
            if (isPrime(tmp)) {
                System.out.println(left);
                System.out.println(tmp);
                break;
            }
            left--;
        }
    }
}
